-
Notifications
You must be signed in to change notification settings - Fork 15
homework_1 #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
homework_1 #7
Conversation
task_01/src/topology_sort.cpp
Outdated
@@ -1 +1,65 @@ | |||
#include "topology_sort.hpp" | |||
|
|||
// O(logn) | |||
int BinSearch(std::vector<int> mas, int num) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mas, n, l, r - плохие названия переменных
task_01/src/topology_sort.cpp
Outdated
int n = mas.size(); | ||
int l = 0; | ||
int r = n - 1; | ||
int ind = n / 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ind это index? если да, то давай не будем экономить символы
task_01/src/topology_sort.cpp
Outdated
right--; | ||
} | ||
} | ||
return {-1, -1}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
как отличить результат (-1, -1) от отсутствия результата?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
такого результата не может быть ни в каком случае, оба числа это индексы от 0 до len-1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ок
task_01/src/topology_sort.cpp
Outdated
right--; | ||
} | ||
} | ||
return {-1, -1}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ок
task_01/src/topology_sort.hpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
давай файлы переименуем с тем что в них содержится
task_02/src/stack.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это же 1ое задание? тогда верни как было, что бы тесты проходили
No description provided.